package com.sphere.freereader.entity;

import java.util.ArrayList;

/**
 * Created by aquarius on 2016/8/8.
 */
public class ArticleInfo {

    // 作品名字
    private String mActicleName;

    // 文章概述概括
    private String mSummary;

    private String mAuthor;

    // 文章类别 比如中国近现在名著
    private String mCategory;

    private ArrayList<SimpleChapterInfo> mChapterListInfos;


    // TODO

    class SimpleChapterInfo{

        String mChapterTitle;  // 章节标题
        String mChapterUrl;    // 章节地址

        public SimpleChapterInfo(String mChapterTitle, String mChapterUrl) {
            this.mChapterTitle = mChapterTitle;
            this.mChapterUrl = mChapterUrl;
        }

        public String getmChapterTitle() {
            return mChapterTitle;
        }

        public void setmChapterTitle(String mChapterTitle) {
            this.mChapterTitle = mChapterTitle;
        }

        public String getmChapterUrl() {
            return mChapterUrl;
        }

        public void setmChapterUrl(String mChapterUrl) {
            this.mChapterUrl = mChapterUrl;
        }

        @Override
        public int hashCode() {
            int result = 17;
            result = 31 * result + mChapterTitle.hashCode();
            result = 31 * result + mChapterUrl.hashCode();
            return result;
        }

        @Override
        public boolean equals(Object o) {

            if (o == this) {
                return true;
            }

            if (o == null) {
                return false;
            }

            if (!(o instanceof SimpleChapterInfo)) {
                return false;
            }

            SimpleChapterInfo info = (SimpleChapterInfo) o;

            if (!info.mChapterUrl.equals(mChapterUrl)) {
                return false;
            }

            if (!info.mChapterTitle.equals(mChapterTitle)) {
                return false;
            }

            return true;
        }

        @Override
        public String toString() {
            return "SimpleChapterInfo{" +
                    "mChapterTitle='" + mChapterTitle + '\'' +
                    ", mChapterUrl='" + mChapterUrl + '\'' +
                    '}';
        }
    }
}
